package ua.kharkov.knure.pereverziev.diploma.db.DAOServices;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import ua.kharkov.knure.pereverziev.diploma.db.entity.UserStatus;

public class UserStatusService extends CommonService<UserStatus> {

	private final Logger log = LoggerFactory.getLogger(UserStatus.class);

	public UserStatusService() {
		super(UserStatus.class);
	}

	public UserStatus getStatysByName(final String status) {
		final List<UserStatus> statuses = getList(new UserStatus(status));
		UserStatus userStatus = null;
		if (statuses != null && statuses.size() == 1)
			userStatus = statuses.get(0);
		else
			log.warn("No or more than one record found for status=" + status);
		return userStatus;
	}

}
